In the instant messaging field, technology for releasing key-value data is often used in many business scenarios. For example, when a certain user logs in an instant messaging client, a friend list needs to be pulled from a server. The friend listing includes account number and the data of describing account property (such as the time when is friended) of a friend. This account number as a unique identification can be abstracted as key. The data associated with this account number can be abstracted as value. Each friend of the friend listing corresponds to a record of key-value data. These records of key-value data can form the key-value data of this user.
Currently, in the instant messaging field, the following two methods are generally used for releasing key-value data. One method includes: pulling full amount key-value data from the server, each time when a user logs in an instant messaging client. Another method includes: adding a serial number to the key-value data. Whenever the key-value data of the server change for one time, the serial number is added by one. When the client is firstly logged in, the key-value data and the serial number are pulled from the server and cached in the client. When the client is logged in for next time, the cached serial number is submitted to the server and the server determines whether the serial number submitted by the client is consistent with the local serial number. When the submitted serial number is consistent with the local serial number, the server does not release the key-value data. When the submitted serial number is not consistent with the local serial number, the server releases the full amount key-value data and the latest serial number for the client to locally cache after receiving.
For the above method that the full amount key-value data are pulled from the server, each time when the instant messaging client is logged in, the user key-value data would remain the same and would not have any changes in most of the time, although this can be easily realized and the client does not need to cache the server data. Each time when logging in to pull the full amount key-value data, for the instant messaging service with huge amount of users, network bandwidth may be enormously wasted.
For the above method involving adding a serial number to the key-value data, although the method can avoid waste of the network bandwidth for full-amount pulling key-value data each time when the client logs in, with the development of instant messaging service, the user key-value data become more and more enriched. For example, a user may have about 5000 records of key-value data, and each record of the key-value data may averagely have a length of about 20 bytes, and a total length of the key-value data can thus be about 100 KB. As long as one of the records having the length of 20 bytes changes, the serial number is added by 1. When the client logs in next time, the full amount data of 100K have to be pulled, although only 20 bytes data amount actually need to be released. In this case, the usage rate of the network bandwidth is very low.